<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <meta name="Generator" content="EditPlus®">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
  <title>Document</title>
 </head>
 <body>
    <button id="open">打开窗口</button>
	<button id="close">关闭窗口</button>
 </body>
 <script>
    var $ = function(obj){
	    return document.getElementById(obj);
	}
	window.onload = function(){
	   var myclose;
	   $("open").onclick = function(){
	      myclose = window.open("http://zhiliaotang.com","_blank","toolbar=yes,loaction=yes,width=300,height=300,resizable=no");
	   }
	   $("close").onclick = function(){
	     myclose.close();
	   } 
	}
 </script>
</html>
